﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="ProfitClear.aspx.cs" Inherits="Finance_ProfitClear" %>
<%@ Register Src="../usercontrol/PageUrlGridView.ascx" TagName="PageUrlGridView" TagPrefix="uc1" %>
<html>
<head id="Head1" runat="server">
<title>财务管理 >> 利润分析</title>
<link href="../css/adminCss.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="../js/changerows.js"></script>
<script type="text/javascript" src="../js/rl.js"></script>
<script type="text/javascript">
function PrintData(id)
{
	if(id!="")
	{
		window.open("../Sales/DrawPrint1.aspx?id="+id,"","width=800px,height=650px,left=100px,top=30px,scrollbars=yes");
	}
}
</script>
<link href="../js/loading.css" rel="stylesheet" type="text/css" />
</head>
<script type="text/javascript" src="../js/loading.js" charset="gb2312"></script>
<body>
    <form id="form1" runat="server">
        <table width="99%" border="0" cellpadding="0" cellspacing="0">
            <tr>
                <td width="2%" height="22"><img src="../images/module.gif" width="20" height="22"/></td>
                <td align="left" ><asp:Label ID="lblPath" runat="server"></asp:Label></td>
                <td  height="22" width="10%" align="right"><a href="javascript:location.href=document.referrer;" ><img src="../images/history.gif" border="0" /></a></td>
              
            </tr>
        </table>
        <table width="99%" border="0" cellpadding="0" cellspacing="0">
          <tr>
            <td bgcolor="#3CB6E5" height="5px"></td>
          </tr>
        </table>
        <table width="99%" border="0" cellpadding="0" cellspacing="0">
          <tr>
            <td height="22" align="right"><img src="../images/search.gif" alt="搜索" width="16" height="16" />
                    查询日期：<asp:TextBox ID="txtKdate" runat="server" CssClass="input1" Width="70" MaxLength="10" onclick="SelectDate(this.name)"></asp:TextBox>至<asp:TextBox ID="txtJdate" runat="server" CssClass="input1" Width="70" MaxLength="10" onclick="SelectDate(this.name)"></asp:TextBox>客户名称：<asp:TextBox ID="GuestName" runat="server" CssClass="input1" Width="60"></asp:TextBox>
                    单号：<asp:TextBox ID="SalesCode" runat="server" CssClass="input1" Width="60"></asp:TextBox>
                    商品名称：<asp:TextBox ID="ComoditiesName" runat="server" CssClass="input1" Width="60"></asp:TextBox>
                类型：<asp:TextBox ID="TypeName" runat="server" CssClass="input1" Width="60"></asp:TextBox>品牌：<asp:TextBox ID="brand" runat="server" CssClass="input1" Width="60"></asp:TextBox>销售类型：<asp:DropDownList
                            ID="ddltypeSale" runat="server">
                            <asp:ListItem Value="">全部</asp:ListItem>
                            <asp:ListItem Value="1">零售</asp:ListItem>
                            <asp:ListItem Value="2">批发</asp:ListItem>
                            <asp:ListItem Value="3">工程</asp:ListItem>
                        </asp:DropDownList>
                        部门：<asp:DropDownList ID="ddrDepartment" runat="server">
                        </asp:DropDownList>
            <asp:Button ID="btnSearch" runat="server" Text="搜 索" CssClass="submit" OnClick="btnSearch_Click" /></td>
          </tr>
        </table>
        <table width="99%" border="0" cellpadding="0" cellspacing="0">
            <tr>
                <td bgcolor="#3CB6E5" height="5px">
                </td>
            </tr>
        </table>
        <asp:GridView ID="GvData" runat="server" Width="99%" AutoGenerateColumns="False" CssClass="gridview" EmptyDataText="没有数据" OnRowDataBound="GvData_RowDataBound">
             <RowStyle Height="25px" />
            <PagerSettings Visible="False" />
            <Columns>
                <asp:BoundField HeaderText="客户名称" DataField="GuestName"  ItemStyle-CssClass="nobr"/>
                <asp:BoundField HeaderText="联系电话" DataField="Phone"  ItemStyle-CssClass="nobr"/>
                <asp:BoundField HeaderText="联系地址" DataField="Address"  ItemStyle-CssClass="nobr"/>
                <asp:TemplateField HeaderText="开单日期" ItemStyle-CssClass="nobr">
                    <ItemTemplate>
                        <asp:Label ID="Label1" runat="server" Text='<%# Bind("c_date","{0:d}") %>'></asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:BoundField HeaderText="品牌" DataField="brand"  ItemStyle-CssClass="nobr"/>
                <asp:BoundField HeaderText="类型" DataField="TypeName"  ItemStyle-CssClass="nobr"/>
                <asp:BoundField HeaderText="商品名称" DataField="comodName"  ItemStyle-CssClass="nobr"/>
                <asp:BoundField HeaderText="备注" DataField="SalesContent" />
                <asp:BoundField HeaderText="型号" DataField="modul" ItemStyle-CssClass="nobr"/>
                <asp:TemplateField HeaderText="进价" ItemStyle-CssClass="nobr">
                    <ItemTemplate>
                        <asp:Label ID="Label0" runat="server" Text='<%# Bind("SuppliMoney","{0:f2}") %>'></asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="成交价" ItemStyle-CssClass="nobr">
                    <ItemTemplate>
                        <asp:Label ID="Label1" runat="server" Text='<%# Bind("practical","{0:f2}") %>'></asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:BoundField HeaderText="数量" DataField="number" ItemStyle-CssClass="nobr"/>
                <asp:TemplateField HeaderText="总金额" ItemStyle-CssClass="nobr">
                    <ItemTemplate>
                        <asp:Label ID="Label2" runat="server" Text='<%# Bind("Totalpractical","{0:f2}") %>'></asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="利润" ItemStyle-CssClass="nobr">
                    <ItemTemplate>
                        <asp:Label ID="Label3" runat="server" Text='<%# Bind("Profit","{0:f2}") %>'></asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:BoundField HeaderText="类型" DataField="typeSale" ItemStyle-CssClass="nobr"/>
                <asp:BoundField HeaderText="部门" DataField="deptName" ItemStyle-CssClass="nobr" />
                <asp:BoundField HeaderText="销售员" DataField="StaffName" ItemStyle-CssClass="nobr" />
                <asp:TemplateField HeaderText="打印"  ItemStyle-CssClass="nobr">
                    <ItemTemplate>
                    <a href="javascript:PrintData('<%#Eval("SalesCode")%>')" class="F_red">打印</a>
                    </ItemTemplate>
                </asp:TemplateField>
            </Columns>
            <RowStyle HorizontalAlign="Center" />
            <EmptyDataRowStyle ForeColor="Red" HorizontalAlign="Center" />
        </asp:GridView>
        <table align="center" width="99%">
        <tr >
            <td ><uc1:PageUrlGridView ID="PageNavigator1" runat="server" DataId="GvData" ConnectionString="connstr" ShowType="Text" PageSize="20" /></td>
            <td align="right" >
                合计→数量：<asp:Label ID="countSaleNum" runat="server" Text="" CssClass="F_red"/>，总金额：<asp:Label ID="countSaleMoney" runat="server" Text="" CssClass="F_red"/>元，总利润：<asp:Label ID="countProfit" runat="server" Text="" CssClass="F_red"/>元。<asp:Button ID="Excel" runat="server" Text="生成" CssClass="inputExcel"  OnClick="Excel_Click"   />
            </td>
        </tr>
        </table>
        <asp:HiddenField ID="hfxs" runat="server" />
        <asp:HiddenField ID="HidWareid" runat="server" />
    </form>
</body>
</html>
<script language="javascript"><!--
//senfe("表格名称","奇数行背景","偶数行背景","鼠标经过背景","点击后背景");
 senfe("GvData","#ECF9FC","#FFFFFF","#D6F1F8");
--></script>